//
//  LoadingViewController.m
//  PrivateSteward
//
//  Created by lanou3g on 16/4/5.
//  Copyright © 2016年 闫贺晨. All rights reserved.
//

#import "LoadingViewController.h"
#import "typeValue.h"
#import "JYPlayVideo.h"
#import "JCAlertView.h"
#import "JYTakeVideo.h"
#import "SVProgressHUD.h"
#import "TAlertView.h"
@interface LoadingViewController ()
@property (weak, nonatomic) IBOutlet UILabel *oneLabel;
@property (weak, nonatomic) IBOutlet UITextField *oneText;
@property (weak, nonatomic) IBOutlet UILabel *twoLabel;
@property (weak, nonatomic) IBOutlet UITextField *twoText;
@property (weak, nonatomic) IBOutlet UILabel *threeLabel;

@property (weak, nonatomic) IBOutlet UITextField *threeText;

@end

@implementation LoadingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    typeValue *type = [typeValue TimeTypeValue];
    if ([type.timeType isEqualToString:@"LOVE"] != 0)
    {
        //爱情囊输入设置
        self.oneLabel.text = @"男生";
        self.oneText.placeholder = @"女生对男生的爱称";
        self.twoLabel.text = @"女生";
        self.twoText.placeholder = @"男生对女生的爱称";
        self.threeLabel.hidden = YES;
        self.threeText.hidden = YES;
        
        
    }else if ([type.timeType isEqualToString:@"my"] != 0)
    {
        //亲情囊输入设置
        self.oneLabel.text = @"录制人";
        self.twoLabel.text = @"年纪";
        self.oneText.placeholder = @"输入你的姓名";
        self.twoText.text = @"您的年纪";
        self.threeLabel.hidden = YES;
        
        
        
        
    }else if ([type.timeType isEqualToString:@"affection"] != 0)
    {
        //友情囊输入设置
      
        self.threeLabel.hidden = YES;
        self.threeText.hidden = YES;
        self.twoLabel.hidden = YES;
        self.twoText.hidden = YES;
        self.oneLabel.hidden = YES;
        self.oneText.hidden = YES;
        
    }else if([type.timeType isEqualToString:@"friend"])
    {
        
        
        self.twoLabel.text = @"人数";
        self.twoText.placeholder = @"咱们一共几个人";

        self.threeLabel.hidden = YES;
        self.threeText.hidden = YES;
        self.oneText.hidden = YES;
        self.oneLabel.hidden = YES;

//        //阅后即焚
//        self.oneLabel.text = @"发送人";
//        self.oneText.placeholder = @"输入发送人昵称";
//        self.twoLabel.text = @"接收人";
//        self.twoText.placeholder = @"输入接收人信息";
//        self.threeLabel.text = @"赠语";
//        self.threeText.placeholder = @"输入送与接收人的赠语";
       
        
    }

    
}


- (IBAction)Play_Click:(id)sender {
    
    typeValue *type = [typeValue TimeTypeValue];
    if ([type.timeType isEqualToString:@"Love"] != 0) {
        
        [JCAlertView  showTwoButtonsWithTitle:@"两个人一起制作" Message:@"请先让您的另一半先离开" ButtonType:JCAlertViewButtonTypeWarn ButtonTitle:@"男士先来" Click:^{
            type.manTO = NO;
            
            [self popTWO];
            
        } ButtonType:JCAlertViewButtonTypeWarn ButtonTitle:@"女士先来" Click:^{
            
            type.manTO = YES;
            
            [self popTWO];
        }];
    }else
    {
        
        [self popUP];
    }
    
    
    
    
    
}


- (void)popTWO
{
    [JCAlertView showTwoButtonsWithTitle:@"请确认" Message:@"确认一下ta没有偷偷看你" ButtonType:JCAlertViewButtonTypeWarn ButtonTitle:@"确定" Click:^{
        
        [self popUP];
        
    } ButtonType:JCAlertViewButtonTypeWarn ButtonTitle:@"确定" Click:^{
        
        [self popUP];
        
    }];
    
    
    
}


- (void)popUP
{
    typeValue *type = [typeValue TimeTypeValue];
    [JCAlertView showTwoButtonsWithTitle:@"是否开启提示" Message:@"开启提示将对您的录制过程简单的规划" ButtonType:JCAlertViewButtonTypeCancel ButtonTitle:@"是" Click:^{
        type.timePrompt = YES;
        [self jump];
    } ButtonType:JCAlertViewButtonTypeDefault ButtonTitle:@"否" Click:^{
        type.timePrompt = NO;
        
        
        [self jump];
    }];
    
}
//跳转页面
- (void)jump
{
    
    if ([self.oneText.text isEqualToString:@""] == 0 && [self.twoText.text isEqualToString:@""] == 0)
    {
        JYTakeVideo *vc= [[JYTakeVideo  alloc]init];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
        UIWindow *window = [UIApplication sharedApplication].delegate.window;
        window.rootViewController =nav;
        typeValue *type = [typeValue TimeTypeValue];
        type.oneText = self.oneText.text;
        type.twoText = self.twoText.text;
        type.therrText  = self.threeLabel.text;
        
    }else
    {
        [[[TAlertView alloc] initWithTitle:@"提示" andMessage:@"信息输入不完整"] show];
        
    }
    
    
    
}
//点击时候键盘
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.oneText resignFirstResponder];
    [self.twoText resignFirstResponder];
    [self.threeText resignFirstResponder];
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
